<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "DTD/xhtml1-strict.dtd">
<html><head><title>QMetaType Class Reference</title><style>h3.fn,span.fn { margin-left: 1cm; text-indent: -1cm }
a:link { color: #004faf; text-decoration: none }
a:visited { color: #672967; text-decoration: none }
td.postheader { font-family: sans-serif }
tr.address { font-family: sans-serif }
body { background: #ffffff; color: black; }
</style></head><body><table border="0" cellpadding="0" cellspacing="0" width="100%"><tr /><td align="left" valign="top" width="32"><img align="left" border="0" height="32" src="images/rb-logo.png" width="32" /></td><td width="1">&#160;&#160;</td><td class="postheader" valign="center"><a href="index.html"><font color="#004faf">Home</font></a>&#160;&#183; <a href="classes.html"><font color="#004faf">All Classes</font></a>&#160;&#183; <a href="modules.html"><font color="#004faf">Modules</font></a></td></table><h1 align="center">QMetaType Class Reference<br /><sup><sup>[<a href="qtcore.html">QtCore</a> module]</sup></sup></h1><p>The QMetaType class manages named types in the meta-object
system. <a href="#details">More...</a></p>

<h3>Types</h3><ul><li><div class="fn" />enum <b><a href="qmetatype.html#Type-enum">Type</a></b> { Void, Bool, Int, UInt, ..., User }</li></ul><h3>Methods</h3><ul><li><div class="fn" /><b><a href="qmetatype.html#QMetaType">__init__</a></b> (<i>self</i>)</li><li><div class="fn" /><b><a href="qmetatype.html#QMetaType-2">__init__</a></b> (<i>self</i>, QMetaType)</li></ul><h3>Static Methods</h3><ul><li><div class="fn" />bool <b><a href="qmetatype.html#isRegistered">isRegistered</a></b> (int&#160;<i>type</i>)</li><li><div class="fn" />int <b><a href="qmetatype.html#type">type</a></b> (str&#160;<i>typeName</i>)</li><li><div class="fn" />str <b><a href="qmetatype.html#typeName">typeName</a></b> (int&#160;<i>type</i>)</li></ul><a name="details" /><hr /><h2>Detailed Description</h2><p>The QMetaType class manages named types in the meta-object
system.</p>
<p>The class is used as a helper to marshall types in <a href="qmetatype.html#Type-enum">QVariant</a> and in queued signals and
slots connections. It associates a type name to a type so that it
can be created and destructed dynamically at run-time. Declare new
types with <a href="qmetatype.html#Q_DECLARE_METATYPE">Q_DECLARE_METATYPE</a>() to
make them available to <a href="qmetatype.html#Type-enum">QVariant</a> and other template-based
functions. Call <a href="qmetatype.html#qRegisterMetaType">qRegisterMetaType</a>() to make
type available to non-template based functions, such as the queued
signal and slot connections.</p>
<p>Any class or struct that has a public default constructor, a
public copy constructor, and a public destructor can be
registered.</p>
<p>The following code allocates and destructs an instance of
<tt>MyClass</tt>:</p>
<pre class="cpp">
 <span class="type">int</span> id <span class="operator">=</span> <span class="type">QMetaType</span><span class="operator">.</span><a href="qmetatype.html#type">type</a>(<span class="string">"MyClass"</span>);
 <span class="keyword">if</span> (id <span class="operator">!</span><span class="operator">=</span> <span class="number">0</span>) {
     <span class="type">void</span> <span class="operator">*</span>myClassPtr <span class="operator">=</span> <span class="type">QMetaType</span><span class="operator">.</span>construct(id);
     <span class="operator">.</span><span class="operator">.</span><span class="operator">.</span>
     <span class="type">QMetaType</span><span class="operator">.</span>destroy(id<span class="operator">,</span> myClassPtr);
     myClassPtr <span class="operator">=</span> <span class="number">0</span>;
 }
</pre>
<p>If we want the stream operators <tt>operator&lt;&lt;()</tt> and
<tt>operator&gt;&gt;()</tt> to work on <a href="qmetatype.html#Type-enum">QVariant</a> objects that store custom
types, the custom type must provide <tt>operator&lt;&lt;()</tt> and
<tt>operator&gt;&gt;()</tt> operators.</p>
<hr /><h2>Type Documentation</h2><h3 class="fn"><a name="Type-enum" />QMetaType.Type</h3><p>These are the built-in types supported by <a href="qmetatype.html">QMetaType</a>:</p>
<table class="valuelist">
<tr class="odd" valign="top">
<th class="tblConst">Constant</th>
<th class="tblval">Value</th>
<th class="tbldscr">Description</th>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.Void</tt></td>
<td class="topAlign"><tt>0</tt></td>
<td class="topAlign"><tt>void</tt></td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.Bool</tt></td>
<td class="topAlign"><tt>1</tt></td>
<td class="topAlign"><tt>bool</tt></td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.Int</tt></td>
<td class="topAlign"><tt>2</tt></td>
<td class="topAlign"><tt>int</tt></td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.UInt</tt></td>
<td class="topAlign"><tt>3</tt></td>
<td class="topAlign"><tt>unsigned int</tt></td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.Double</tt></td>
<td class="topAlign"><tt>6</tt></td>
<td class="topAlign"><tt>double</tt></td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.QChar</tt></td>
<td class="topAlign"><tt>7</tt></td>
<td class="topAlign">QChar</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.QString</tt></td>
<td class="topAlign"><tt>10</tt></td>
<td class="topAlign">QString</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.QByteArray</tt></td>
<td class="topAlign"><tt>12</tt></td>
<td class="topAlign">QByteArray</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.VoidStar</tt></td>
<td class="topAlign"><tt>128</tt></td>
<td class="topAlign"><tt>void *</tt></td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.Long</tt></td>
<td class="topAlign"><tt>129</tt></td>
<td class="topAlign"><tt>long</tt></td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.LongLong</tt></td>
<td class="topAlign"><tt>4</tt></td>
<td class="topAlign">LongLong</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.Short</tt></td>
<td class="topAlign"><tt>130</tt></td>
<td class="topAlign"><tt>short</tt></td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.Char</tt></td>
<td class="topAlign"><tt>131</tt></td>
<td class="topAlign"><tt>char</tt></td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.ULong</tt></td>
<td class="topAlign"><tt>132</tt></td>
<td class="topAlign"><tt>unsigned long</tt></td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.ULongLong</tt></td>
<td class="topAlign"><tt>5</tt></td>
<td class="topAlign">ULongLong</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.UShort</tt></td>
<td class="topAlign"><tt>133</tt></td>
<td class="topAlign"><tt>unsigned short</tt></td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.UChar</tt></td>
<td class="topAlign"><tt>134</tt></td>
<td class="topAlign"><tt>unsigned char</tt></td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.Float</tt></td>
<td class="topAlign"><tt>135</tt></td>
<td class="topAlign"><tt>float</tt></td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.QObjectStar</tt></td>
<td class="topAlign"><tt>136</tt></td>
<td class="topAlign"><a href="qobject.html">QObject</a> *</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.QWidgetStar</tt></td>
<td class="topAlign"><tt>137</tt></td>
<td class="topAlign"><a href="qwidget.html">QWidget</a> *</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.QVariant</tt></td>
<td class="topAlign"><tt>138</tt></td>
<td class="topAlign">QVariant</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.QColorGroup</tt></td>
<td class="topAlign"><tt>63</tt></td>
<td class="topAlign">QColorGroup</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.QCursor</tt></td>
<td class="topAlign"><tt>74</tt></td>
<td class="topAlign">QCursor</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.QDate</tt></td>
<td class="topAlign"><tt>14</tt></td>
<td class="topAlign">QDate</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.QSize</tt></td>
<td class="topAlign"><tt>21</tt></td>
<td class="topAlign">QSize</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.QTime</tt></td>
<td class="topAlign"><tt>15</tt></td>
<td class="topAlign">QTime</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.QVariantList</tt></td>
<td class="topAlign"><tt>9</tt></td>
<td class="topAlign">QVariantList</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.QPolygon</tt></td>
<td class="topAlign"><tt>71</tt></td>
<td class="topAlign">QPolygon</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.QColor</tt></td>
<td class="topAlign"><tt>67</tt></td>
<td class="topAlign">QColor</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.QSizeF</tt></td>
<td class="topAlign"><tt>22</tt></td>
<td class="topAlign">QSizeF</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.QRectF</tt></td>
<td class="topAlign"><tt>20</tt></td>
<td class="topAlign">QRectF</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.QLine</tt></td>
<td class="topAlign"><tt>23</tt></td>
<td class="topAlign">QLine</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.QTextLength</tt></td>
<td class="topAlign"><tt>78</tt></td>
<td class="topAlign">QTextLength</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.QStringList</tt></td>
<td class="topAlign"><tt>11</tt></td>
<td class="topAlign">QStringList</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.QVariantMap</tt></td>
<td class="topAlign"><tt>8</tt></td>
<td class="topAlign">QVariantMap</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.QVariantHash</tt></td>
<td class="topAlign"><tt>28</tt></td>
<td class="topAlign">QVariantHash</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.QIcon</tt></td>
<td class="topAlign"><tt>69</tt></td>
<td class="topAlign">QIcon</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.QPen</tt></td>
<td class="topAlign"><tt>77</tt></td>
<td class="topAlign">QPen</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.QLineF</tt></td>
<td class="topAlign"><tt>24</tt></td>
<td class="topAlign">QLineF</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.QTextFormat</tt></td>
<td class="topAlign"><tt>79</tt></td>
<td class="topAlign">QTextFormat</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.QRect</tt></td>
<td class="topAlign"><tt>19</tt></td>
<td class="topAlign">QRect</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.QPoint</tt></td>
<td class="topAlign"><tt>25</tt></td>
<td class="topAlign">QPoint</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.QUrl</tt></td>
<td class="topAlign"><tt>17</tt></td>
<td class="topAlign">QUrl</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.QRegExp</tt></td>
<td class="topAlign"><tt>27</tt></td>
<td class="topAlign">QRegExp</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.QDateTime</tt></td>
<td class="topAlign"><tt>16</tt></td>
<td class="topAlign">QDateTime</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.QPointF</tt></td>
<td class="topAlign"><tt>26</tt></td>
<td class="topAlign">QPointF</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.QPalette</tt></td>
<td class="topAlign"><tt>68</tt></td>
<td class="topAlign">QPalette</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.QFont</tt></td>
<td class="topAlign"><tt>64</tt></td>
<td class="topAlign">QFont</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.QBrush</tt></td>
<td class="topAlign"><tt>66</tt></td>
<td class="topAlign">QBrush</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.QRegion</tt></td>
<td class="topAlign"><tt>72</tt></td>
<td class="topAlign">QRegion</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.QBitArray</tt></td>
<td class="topAlign"><tt>13</tt></td>
<td class="topAlign">QBitArray</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.QImage</tt></td>
<td class="topAlign"><tt>70</tt></td>
<td class="topAlign">QImage</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.QKeySequence</tt></td>
<td class="topAlign"><tt>76</tt></td>
<td class="topAlign">QKeySequence</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.QSizePolicy</tt></td>
<td class="topAlign"><tt>75</tt></td>
<td class="topAlign">QSizePolicy</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.QPixmap</tt></td>
<td class="topAlign"><tt>65</tt></td>
<td class="topAlign">QPixmap</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.QLocale</tt></td>
<td class="topAlign"><tt>18</tt></td>
<td class="topAlign">QLocale</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.QBitmap</tt></td>
<td class="topAlign"><tt>73</tt></td>
<td class="topAlign">QBitmap</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.QMatrix</tt></td>
<td class="topAlign"><tt>80</tt></td>
<td class="topAlign">QMatrix</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.QTransform</tt></td>
<td class="topAlign"><tt>81</tt></td>
<td class="topAlign">QTransform</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.QMatrix4x4</tt></td>
<td class="topAlign"><tt>82</tt></td>
<td class="topAlign">QMatrix4x4</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.QVector2D</tt></td>
<td class="topAlign"><tt>83</tt></td>
<td class="topAlign">QVector2D</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.QVector3D</tt></td>
<td class="topAlign"><tt>84</tt></td>
<td class="topAlign">QVector3D</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.QVector4D</tt></td>
<td class="topAlign"><tt>85</tt></td>
<td class="topAlign">QVector4D</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.QQuaternion</tt></td>
<td class="topAlign"><tt>86</tt></td>
<td class="topAlign">QQuaternion</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.QEasingCurve</tt></td>
<td class="topAlign"><tt>29</tt></td>
<td class="topAlign">QEasingCurve</td>
</tr>
<tr>
<td class="topAlign"><tt>QMetaType.User</tt></td>
<td class="topAlign"><tt>256</tt></td>
<td class="topAlign">Base value for user types</td>
</tr>
</table>
<p>Additional types can be registered using <a href="qmetatype.html#Q_DECLARE_METATYPE">Q_DECLARE_METATYPE</a>().</p>
<p><b>See also</b> <a href="qmetatype.html#type">type</a>() and
<a href="qmetatype.html#typeName">typeName</a>().</p>
<hr /><h2>Method Documentation</h2><h3 class="fn"><a name="QMetaType" />QMetaType.__init__ (<i>self</i>)</h3><h3 class="fn"><a name="QMetaType-2" />QMetaType.__init__ (<i>self</i>, <a href="qmetatype.html">QMetaType</a>)</h3><h3 class="fn"><a name="isRegistered" />bool QMetaType.isRegistered (int&#160;<i>type</i>)</h3><p>Returns true if the datatype with ID <i>type</i> is registered;
otherwise returns false.</p>
<p><b>See also</b> <a href="qmetatype.html#type">type</a>(),
<a href="qmetatype.html#typeName">typeName</a>(), and <a href="qmetatype.html#Type-enum">Type</a>.</p>


<h3 class="fn"><a name="type" />int QMetaType.type (str&#160;<i>typeName</i>)</h3><p>Returns a handle to the type called <i>typeName</i>, or 0 if
there is no such type.</p>
<p><b>See also</b> <a href="qmetatype.html#isRegistered">isRegistered</a>(), <a href="qmetatype.html#typeName">typeName</a>(), and <a href="qmetatype.html#Type-enum">Type</a>.</p>


<h3 class="fn"><a name="typeName" />str QMetaType.typeName (int&#160;<i>type</i>)</h3><p>Returns the type name associated with the given <i>type</i>, or
0 if no matching type was found. The returned pointer must not be
deleted.</p>
<p><b>See also</b> <a href="qmetatype.html#type">type</a>(),
<a href="qmetatype.html#isRegistered">isRegistered</a>(), and
<a href="qmetatype.html#Type-enum">Type</a>.</p>


<address><hr /><div align="center"><table border="0" cellspacing="0" width="100%"><tr class="address"><td align="left" width="25%">PyQt&#160;snapshot-4.9.5-9eb6aac99275 for X11</td><td align="center" width="50%">Copyright &#169; <a href="http://www.riverbankcomputing.com">Riverbank&#160;Computing&#160;Ltd</a> and <a href="http://www.qtsoftware.com">Nokia</a> 2012</td><td align="right" width="25%">Qt&#160;4.8.3</td></tr></table></div></address></body></html>